package com.crm.business.admin.service;

import cn.hutool.core.util.StrUtil;
import com.crm.common.ka.core.common.Result;
import com.crm.common.ka.core.servlet.upload.FileEntity;
import com.crm.common.ka.core.servlet.upload.UploadEntity;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Collection;
import java.util.List;

/**
 * @author zhangzhiwei
 * 文件操作相关接口
 */
public interface AdminFileService {
    /**
     * 根据batchId查询文件列表
     *
     * @param batchId batchId
     * @return data
     */
    public List<FileEntity> queryFileList(String batchId);

    /**
     * 根据fileId查询文件
     *
     * @param fileId 文件ID
     * @return data
     */
    public FileEntity queryById(Long fileId);

    public List<FileEntity> queryByIds(Collection<Long> fileIds);

    /**
     * 根据batchId查询单个文件
     *
     * @param batchId batchId
     * @return data
     */
    public FileEntity queryOne(String batchId);

    /**
     * 根据fileId删除文件
     *
     * @param fileId 文件ID
     * @return data
     */
    public void delete(Object fileId);

    /**
     * 根据batchId删除文件
     *
     * @param batchId batchId
     * @return data
     */
    public void delete(List<String> batchId);

    public Integer queryNum(List<String> batchId);

    public List<FileEntity> queryFileList(List<String> batchIdList);

    public String copyJxcImg(String batchId);


    public void saveBatchFileEntity(List<String> adminFileIdList, String batchId);

    public UploadEntity upload(MultipartFile file,
                               String batchId,
                               String type, String isPublic) throws IOException;
}
